#include <stdio.h>
#include <string.h>

int main()
{
    char s[1000];
    while (1)
    {
        fgets(s, 1000, stdin);
        int len = strlen(s);
        if (len > 0 && s[len - 1] == '\n')
        {
            s[len - 1] = '\0';
            len--;
        }
        if (len == 18)
        {
            int year = (s[6] - '0') * 1000 + (s[7] - '0') * 100 + (s[8] - '0') * 10 + (s[9] - '0');
            int month = (s[10] - '0') * 10 + (s[11] - '0');
            printf("%d,%d\n", year, month);
            break;
        }
        else
            printf("Invalid data,input again!\n");
    }

    return 0;
}